package com.hospital.controller;


import com.hospital.configure.Result;
import com.hospital.entity.MedicineType;
import com.hospital.service.MedicineTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author WuLiting
 * @since 2021-04-10
 */
@RestController
@RequestMapping("/medicineType")
public class MedicineTypeController {

    @Autowired
    MedicineTypeService medicineTypeService;

    /**
     * 添加/修改
     */
    @RequestMapping("/updateMedicineType")
    public Result<MedicineType> updateMedicineType(@RequestBody MedicineType medicineType) {
        return medicineTypeService.updateMedicineType(medicineType);
    }

    /**
     * 删除
     */
    @RequestMapping("/delMedicineType")
    public Result<MedicineType> delMedicineType(@RequestBody MedicineType medicineType) {
        return medicineTypeService.delMedicineType(medicineType);
    }

    /**
     * 批量删除
     */
    @RequestMapping("/batchDelMedicineType")
    public Result<MedicineType> batchDelMedicineType(@RequestBody MedicineType medicineType) {
        return medicineTypeService.batchDelMedicineType(medicineType);
    }

    /**
     * 查询(不分页)
     */
    @RequestMapping("/queryMedicineType")
    public Result<MedicineType> queryMedicineType(@RequestBody MedicineType medicineType) {
        return medicineTypeService.queryMedicineType(medicineType);
    }

    /**
     * 查询(分页)
     */
    @RequestMapping("/queryMedicineTypeByPage")
    public Result<MedicineType> queryMedicineTypeByPage(@RequestBody MedicineType medicineType) {
        return medicineTypeService.queryMedicineTypeByPage(medicineType);
    }

    /**
     * 根据ID查询
     */
    @RequestMapping("/queryMedicineTypeById")
    public Result<MedicineType> queryMedicineTypeById(@RequestBody MedicineType medicineType) {
        return medicineTypeService.queryMedicineTypeById(medicineType);
    }

}

